[DEFAULT]
debug = {{ searchlight_logging_debug }}

log_dir = /var/log/kolla/searchlight
transport_url = {{ rpc_transport_url }}

[api]
port = {{ searchlight_api_port }}
bind_host = {{ api_interface_address }}
public_endpoint = {{ searchlight_public_endpoint }}
workers = {{ openstack_service_workers }}

[elasticsearch]
hosts = {{ searchlight_elasticsearch_url }}

[listener]
workers = {{ openstack_service_workers }}
notifications_pool = searchlight-listener

[paste_deploy]
flavor = keystone

[keystone_authtoken]
www_authenticate_uri = {{ keystone_internal_url }}
auth_url = {{ keystone_admin_url }}
project_domain_name = {{ default_project_domain_name }}
project_name = service
user_domain_name = {{ default_user_domain_name }}
username = {{ searchlight_keystone_user }}
password = {{ searchlight_keystone_password }}
auth_type = password
cafile = {{ openstack_cacert }}

memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_address(host) | put_address_in_context('memcache') }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}

[oslo_messaging_notifications]
transport_url = {{ notify_transport_url }}
{% if searchlight_enabled_notification_topics %}
driver = messagingv2
topics = {{ searchlight_enabled_notification_topics | map(attribute='name') | join(',') }}
{% else %}
driver = noop
{% endif %}


{% if searchlight_policy_file is defined %}
[oslo_policy]
policy_file = {{ searchlight_policy_file }}
{% endif %}

[service_credentials]
auth_uri = {{ keystone_internal_url }}
auth_url = {{ keystone_admin_url }}
region_name = {{ openstack_region_name }}
project_domain_name = default
project_name = service
user_domain_name = default
username = {{ searchlight_keystone_user }}
password = {{ searchlight_keystone_password }}
auth_type = password
auth_plugin = password
cafile = {{ openstack_cacert }}

memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_address(host) | put_address_in_context('memcache') }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}

[resource_plugin:os_cinder_volume]
enabled = {{ enable_cinder | bool }}

[resource_plugin:os_cinder_snapshot]
enabled = {{ enable_cinder | bool }}

[resource_plugin:os_designate_zone]
enabled = {{ enable_designate | bool }}

[resource_plugin:os_designate_recordset]
enabled = {{ enable_designate | bool }}

[resource_plugin:os_swift_account]
enabled = {{ enable_swift | bool }}

[resource_plugin:os_swift_container]
enabled = {{ enable_swift | bool }}

[resource_plugin:os_swift_object]
enabled = {{ enable_swift | bool }}

[resource_plugin:os_nova_server]
enabled = {{ enable_nova | bool }}

[resource_plugin:os_nova_hypervisor]
enabled = {{ enable_nova | bool }}

[resource_plugin:os_nova_flavor]
enabled = {{ enable_nova | bool }}
notifications_topics_exchanges = versioned_notifications,nova

[resource_plugin:os_nova_servergroup]
enabled = {{ enable_nova | bool }}

[resource_plugin:os_glance_image]
enabled = {{ enable_glance | bool }}

[resource_plugin:os_glance_metadef]
enabled = {{ enable_glance | bool }}

[resource_plugin:os_neutron_net]
enabled = {{ enable_neutron | bool }}

[resource_plugin:os_neutron_port]
enabled = {{ enable_neutron | bool }}

[resource_plugin:os_neutron_floatingip]
enabled = {{ enable_neutron | bool }}

[resource_plugin:os_neutron_security_group]
enabled = {{ enable_neutron | bool }}

[resource_plugin:os_ironic_chassis]
enabled = {{ enable_ironic | bool }}
notifications_topics_exchanges = ironic_versioned_notifications,ironic

[resource_plugin:os_ironic_node]
enabled = {{ enable_ironic | bool }}
notifications_topics_exchanges = ironic_versioned_notifications,ironic

[resource_plugin:os_ironic_port]
enabled = {{ enable_ironic | bool }}
notifications_topics_exchanges = ironic_versioned_notifications,ironic

{# TODO(blallau): enabling osprofiler when fixed in searchlight #}

{# {% if enable_osprofiler | bool %} #}
{# [profiler] #}
{# enabled = true #}
{# trace_sqlalchemy = true #}
{# hmac_keys = {{ osprofiler_secret }} #}
{# connection_string = {{ osprofiler_backend_connection_string }} #}
{# {% endif %} #}
